package jtk.project4.fleet.screen.poReceiptByInventoriedPart;


import java.awt.FlowLayout;

import jtk.project4.fleet.field.PoReceiptByInventoriedPartField;
import jtk.project4.fleet.field.PoReceiptByInventoriedPartField;
import nl.coderight.jazz.form.FormHeader;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.button.PushButton;

public class PoReceiptByInventoriedPartView extends FormView{
	private FormHeader formHeader;
	private PushButton submitButton;
	private PushButton cancelButton;
	
	@Override
	protected void init() {
		// TODO Auto-generated method stub
		createField();
		createLayout();	
	}
	
	private void createField(){
		submitButton = new PushButton("submitAction");
		cancelButton = new PushButton("cancelAction");
	}
	
	private void createLayout(){
		setHeader(createHeader());
		addField(createForm());
		
	}
	
	private FormHeader createHeader(){
		formHeader = new FormHeader();
		formHeader.setTitle("poReceiptByInventoriedPart.header.form");
		return formHeader;
	}
	
	private GroupControl createForm(){
		GroupControl form = new GroupControl();
		form.addField(new PoReceiptByInventoriedPartField("POReceiptByInventoriedPart"),NORTH);
		form.addField(createButtons(), SOUTH);
		return form;
	}
	
	private GroupControl createButtons(){
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); //yg tampil cm cancel button
		buttons.addField(submitButton);
		buttons.addField(cancelButton);
		return buttons;
	}
}
